import "./s.png";
import MyComp from "./test";

class Main extends HTMLDivElement {

    myCompStat1: string = "Hello!";

    constructor() {
        super();
        this.innerHTML = this.gHTML();
    }

    gHTML(): any{
        return(
        <div>
            <h1>
                dfsadfasdf
            </h1>
            <MyComp rootElementProps={{id: "mycomp"}} asdf="asdf" stat1="组件「状态」，通过属性传递"/>
            <button click={() => {
                
            }}/>
        </div>
        );
    }
}

window.onload = () => {
    let body = document.getElementsByTagName("body");
    console.assert(body.length == 1);
    window.customElements.define('app-main', Main, { extends: 'div' });
    console.log(body.length)
    body[0].appendChild(new Main());
}
